package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HospitalSubscribeScheduleTemplateMapper;
import com.ruoyi.system.domain.HospitalSubscribeScheduleTemplate;
import com.ruoyi.system.service.IHospitalSubscribeScheduleTemplateService;

/**
 * 时段模板Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-28
 */
@Service
public class HospitalSubscribeScheduleTemplateServiceImpl implements IHospitalSubscribeScheduleTemplateService 
{
    @Autowired
    private HospitalSubscribeScheduleTemplateMapper hospitalSubscribeScheduleTemplateMapper;

    /**
     * 查询时段模板
     * 
     * @param id 时段模板主键
     * @return 时段模板
     */
    @Override
    public HospitalSubscribeScheduleTemplate selectHospitalSubscribeScheduleTemplateById(Long id)
    {
        return hospitalSubscribeScheduleTemplateMapper.selectHospitalSubscribeScheduleTemplateById(id);
    }

    /**
     * 查询时段模板列表
     * 
     * @param hospitalSubscribeScheduleTemplate 时段模板
     * @return 时段模板
     */
    @Override
    public List<HospitalSubscribeScheduleTemplate> selectHospitalSubscribeScheduleTemplateList(HospitalSubscribeScheduleTemplate hospitalSubscribeScheduleTemplate)
    {
        return hospitalSubscribeScheduleTemplateMapper.selectHospitalSubscribeScheduleTemplateList(hospitalSubscribeScheduleTemplate);
    }

    /**
     * 新增时段模板
     * 
     * @param hospitalSubscribeScheduleTemplate 时段模板
     * @return 结果
     */
    @Override
    public int insertHospitalSubscribeScheduleTemplate(HospitalSubscribeScheduleTemplate hospitalSubscribeScheduleTemplate)
    {
        hospitalSubscribeScheduleTemplate.setCreateTime(DateUtils.getNowDate());
        return hospitalSubscribeScheduleTemplateMapper.insertHospitalSubscribeScheduleTemplate(hospitalSubscribeScheduleTemplate);
    }

    /**
     * 修改时段模板
     * 
     * @param hospitalSubscribeScheduleTemplate 时段模板
     * @return 结果
     */
    @Override
    public int updateHospitalSubscribeScheduleTemplate(HospitalSubscribeScheduleTemplate hospitalSubscribeScheduleTemplate)
    {
        hospitalSubscribeScheduleTemplate.setUpdateTime(DateUtils.getNowDate());
        return hospitalSubscribeScheduleTemplateMapper.updateHospitalSubscribeScheduleTemplate(hospitalSubscribeScheduleTemplate);
    }

    /**
     * 批量删除时段模板
     * 
     * @param ids 需要删除的时段模板主键
     * @return 结果
     */
    @Override
    public int deleteHospitalSubscribeScheduleTemplateByIds(Long[] ids)
    {
        return hospitalSubscribeScheduleTemplateMapper.deleteHospitalSubscribeScheduleTemplateByIds(ids);
    }

    /**
     * 删除时段模板信息
     * 
     * @param id 时段模板主键
     * @return 结果
     */
    @Override
    public int deleteHospitalSubscribeScheduleTemplateById(Long id)
    {
        return hospitalSubscribeScheduleTemplateMapper.deleteHospitalSubscribeScheduleTemplateById(id);
    }
}
